/**
 * P4047 [JSOI2010]部落划分
**/

#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e3+8;

int n, k;
int x[maxn], y[maxn];
struct p {
  int u, v, dist;
  p() = default;
  p(int a, int b):u(a), v(b){
    int dx = abs(x[a]-x[b]), dy=abs(y[a]-y[b]);
    dist = dx*dx+dy*dy;
  }
  bool operator < (const p &b) const {return dist<b.dist;}
}dist[maxn*maxn];
int tot, merged;
int par[maxn];
void init() {for(int i=1; i<n; ++i) par[i]=i;}
int find(int x) {return x==par[x]?x:par[x]=find(par[x]);};
void unite(int u, int v) {par[find(u)]=find(v);}
bool same(int u, int v) {return find(u)==find(v);}

int main() {
  scanf("%d%d\n", &n, &k);
  for(int i=0; i<n; ++i) {
    scanf("%d%d", x+i, y+i);
  }
  init();
  for(int i=0; i<n; ++i) {
    for(int j=i+1; j<n; ++j) {
      dist[tot++] = p(i, j);
    }
  }
  sort(dist, dist+tot);
  int nclans = n;
  int cnt;
  for(cnt=0; cnt<tot; ++cnt) {
    // Make it C++11 Compatible
    // auto [u, v, d] = dist[cnt];
    auto u = dist[cnt].u;
    auto v = dist[cnt].v;
    auto d = dist[cnt].dist;
    if(!same(u, v)) {
      unite(u, v);
      nclans--;
      if(nclans==k) break;
    }
  }
  for(;cnt<tot; ++cnt) {
    // auto [u, v, d] = dist[cnt];
    auto u = dist[cnt].u;
    auto v = dist[cnt].v;
    auto d = dist[cnt].dist;
    if(same(u, v)) continue;
    else {
      printf("%.2f\n", sqrt(d));
      break;
    }
  }
}

